
import AViewController from './ViewController/AViewController'
import ARect from './Views/ARect'
import AView from './Views/AView'
import ATextView, {NSTextAlignment} from './Views/ATextView'


export default class TestViewController extends AViewController {

    loadView() {
        super.loadView()
        this.view.backgroudColor = "#F00"

        let view = new AView()
        view.backgroudColor = "#0F0"
        view.frame = new ARect(50, 50, 100, 100)
        this.view.addSubview(view)

        let subview = new AView()
        subview.backgroudColor = "rgba(0,0,255,0.7)"
        subview.frame = new ARect(10, 10, 80, 80)
        view.addSubview(subview)

        let time =  new Date().getTime()
        for(let i = 0; i<1; i++) {
            let textView = new ATextView()
            let x = Math.random()*320
            let y = Math.random()*568
            textView.frame = new ARect(0, 0, 320, 568)
            textView.backgroudColor = "#FF0"
            textView.text = "foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试fwejiof测试foiawejiof测试foiawejiof测试fwejiof测试foiawejiof测试foiawejiof测试fwejiof测试foiawejiof测试foiawejiof测试fwejiof测试foiawejiof测试foiawejiof测试fwejiof测试foiawejiof测试foiawejiof测试fwejiof测试foiawejiof测试foiawejiof测试fwejiof测试foiawejiof测试foiawejiof测试fwejiof测试foiawejiof测试foiawejiof测试fwejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试foiawejiof测试"
            textView.textColor = "#F0F"
            textView.textAlignment = NSTextAlignment.Right
            this.view.addSubview(textView)
        }
        console.log("for end "+ (new Date().getTime() - time)/1000.0)
    }
}
